import { CopyInfoPanelBase } from "../CopyInfoPanelBase";
import { SEightyCopyInfo } from "../../../../../Message/Public/SEightyCopyInfo";
import { Language } from "../../../../../extend/language/Language";
import { CopyConfig } from "../../../resource/CopyConfig";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { ObjCreate } from "../../common/ObjCreate";
import { SecTimerView } from "../../common/SecTimerView";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { ImagesConst } from "../../../resource/ImagesConst";
import { MagicTowerAwardItems } from "../magicTower/MagicTowerAwardItems";
import { ItemData } from "../../../resource/info/ItemData";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
type int = number;
//class EightyCopyInfoPanel
    
    export  class EightyCopyInfoPanel extends CopyInfoPanelBase
    {
        constructor()
        {
            super();
            return;
        }

        public /* override */ updateInfos(arg1): void
        {
            var loc1=null;
            var loc2=0;
            this._info = arg1 as SEightyCopyInfo;
            if (this._info) 
            {
                this._leftTime = this._info.remainTime;
                if (this._leftTime != -1) 
                {
                    this._timeLabel.setLeftTime(this._leftTime);
                }
                else 
                {
                    this._timeLabel.stop();
                    this._timeLabel.htmlText = Language.getString(60073);
                }
                loc1 = "";
                loc2 = 1;
                while (loc2 <= 3) 
                {
                    loc1 = loc1 + CopyConfig.instance.getEightyCopyDesc(loc2);
                    if (this._info.killBossNum >= loc2) 
                    {
                        loc1 = loc1 + "(1/1)\n";
                    }
                    else 
                    {
                        loc1 = loc1 + "(0/1)\n";
                    }
                    ++loc2;
                }
                this._bossLabel.htmlText = HTMLUtil.addColor(loc1, GlobalStyle.color1);
            }
            return;
        }

        public clean(): void
        {
            this._info = null;
            this._leftTime = 0;
            this._timeLabel.dispose(false);
            return;
        }

        protected /* override */ createChildren(): void
        {
            var loc1=null;
            var loc2=null;
            super.createChildren();
            loc1 = ObjCreate.createGTextField(Language.getString(60456), _left, 5, 240, 20, _bodySp, GlobalStyle.textFormat1);
            loc1.mouseEnabled = false;
            this._timeLabel = new SecTimerView();
            this._timeLabel.defaultTextFormat = new GTextFormat(FontUtil.songtiName, 26, 16711680, true);
            this._timeLabel.x = 50;
            this._timeLabel.y = 25;
            this._timeLabel.width = 180;
            this._timeLabel.height = 40;
            this._timeLabel.setParse("hh: mm: ss");
            this._timeLabel.mouseEnabled = false;
            _bodySp.addChild(this._timeLabel);
            loc1 = ObjCreate.createGTextField(Language.getString(60457), _left, 60, 240, 20, _bodySp, GlobalStyle.textFormat1);
            loc1.mouseEnabled = false;
            this._bossLabel = ObjCreate.createGTextField("", 50, 80, 200, 60, _bodySp, new GTextFormat(FontUtil.songtiName, 12, 11661311, null, null, null, null, null, null, null, null, null, 3));
            this._bossLabel.mouseEnabled = false;
            loc1 = ObjCreate.createGTextField("", _left, this._bossLabel.y + this._bossLabel.height + 5, 240, 40, _bodySp, new GTextFormat(FontUtil.songtiName, 12, 11661311, null, null, null, null, null, null, null, null, null, 3));
            loc1.wordWrap = true;
            loc1.multiline = true;
            loc1.mouseEnabled = false;
            loc1.autoSize = flash.text.TextFieldAutoSize.LEFT;
            loc1.htmlText = CopyConfig.instance.getEightyCopyDesc(0);
            ObjCreate.createBg(_left, loc1.y + loc1.textHeight + 5, 240, 2, _bodySp, ImagesConst.SplitLine);
            loc1 = ObjCreate.createGTextField(Language.getString(60458), _left, loc1.y + loc1.height + 10, 235, 20, _bodySp, new GTextFormat(FontUtil.songtiName, 12, 16776960));
            loc1.mouseEnabled = false;
            loc2 = new MagicTowerAwardItems();
            loc2.x = _left + 20;
            loc2.y = loc1.y + loc1.height + 5;
            loc2.setAwardItems([new ItemData(14045400), new ItemData(14031038), new ItemData(14031400), new ItemData(14047200), new ItemData(14031139)], 5);
            _bodySp.addChild(loc2);
            _bg.height = loc2.y + 45;
            return;
        }

        /* internal */ /* var */_info: SEightyCopyInfo;

        /* internal */ /* var */_leftTime: int;

        /* internal */ /* var */_timeLabel: SecTimerView;

        /* internal */ /* var */_bossLabel: GTextFiled;
    }
